import React, {PureComponent, Fragment} from 'react'
import {connect} from 'react-redux'
import {Button} from 'antd'
import {FormattedMessage} from 'react-intl'

class SubmitBtn extends PureComponent {
    render() {
        const {btnTextId, loading} = this.props
        return (
            <Fragment>
                <Button type='primary' htmlType='submit' loading={loading}>
                   <FormattedMessage id={btnTextId} />
                </Button>

            </Fragment>
        )
    }
}

const mapState = (state) => ({
    btnTextId: state.getIn(['submitBtn', 'btnTextId']),
    loading: state.getIn(['submitBtn', 'loading']),
})

export default connect(mapState, null)(SubmitBtn)
